﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using yq.ControllerBase.ClassLib;

namespace yq.ControllerBase
{
    /// <summary>
    /// 程序启动时加载
    /// AssemblyInfo.cs添加配置
    /// [assembly: System.Web.PreApplicationStartMethod(typeof(yq.ControllerBase.Initializer), "Start")]
    /// </summary>
    public class Initializer
    {
        /// <summary>
        /// 启动调用的项目时调用一次
        /// </summary>
        public static void Start()
        {
            ControllerBuilder.Current.SetControllerFactory(new UnityControllerFactory());
            GlobalFilters.Filters.Add(new ErrorFilterAttribute());
        }
    }
}
